<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ES6 in HTML</title>
</head>
<body>
    <script type="module">
        import { client } from "/node_modules/@gradio/client";
        //const client = require('@gradio/client');

        const app = await client('https://8919j8p607.vicp.fun/');
        const result = await app.predict("/use_qa", [
            "Hello",
        ]);
        console.log(result.data);

    </script>
    <script type="text/javascript">
        // 使用ES6模板字符串
        const greeting = `Hello, ES6!`;
        // 使用let和const
        let count = 0;
        const increment = () => count++;
 
        // 添加一个按钮并绑定点击事件
        const button = document.createElement('button');
        button.textContent = 'Increment';
        button.addEventListener('click', () => {
            document.body.innerHTML += `<p>${greeting} Count: ${increment()}</p>`;
        });
        document.body.appendChild(button);
    </script>
</body>
</html>